package com.lanou3g.store.db;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import java.sql.Connection;
import java.sql.SQLException;

public class DBConnector {

    private static DBConnector instance = new DBConnector();

    public static DBConnector getInstance(){
        return instance;
    }

    private ComboPooledDataSource ds;

    private DBConnector() {
        ds = new ComboPooledDataSource();
    }

    public Connection getConnection() throws SQLException {
        return ds.getConnection();
    }

    public void release() {
        ds.close();

    }


}
